﻿using System.Text.RegularExpressions;

namespace TLDRML.Tokens
{
    public abstract class TokenDefinition
    {
        protected TokenDefinition(Regex regex)
            : this(regex, false)
        {
        }

        protected TokenDefinition(Regex regex, bool isIgnored)
        {
            Regex = regex;
            IsIgnored = isIgnored;
        }

        public abstract Token Create(TokenPosition tokenPosition, string value);

        public bool IsIgnored { get; private set; }
        public Regex Regex { get; private set; }
    }
}
